<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

if (!function_exists('slug')) {

    function slug($str) {
        $CI = & get_instance();
        $CI->load->helper('text');
        $str = convert_accented_characters($str);
        $CI->load->helper('url');

        return trim(stripslashes(strtolower(url_title($str))));
    }

}